const BaseController = require('./base_admin_controller.js');
const SettingMgrService = require('../../service/admin/setting_mgr_service.js');

/**
 * 系统配置管理
 */
class SettingMgrController extends BaseController {

    /**
     * 列表
     */
    async get_setting() {
        let service = new SettingMgrService();
        return await service.get_setting();
    }

    /**
     * 编辑
     */
    async save_setting() {
        // 数据校验
        let rules = {
            list: 'Array|name=配置列表',
        };
        // 取得数据
        let input = this.validateData(rules);
        let service = new SettingMgrService();
        return await service.save_setting(input.list);
    }

}

module.exports = SettingMgrController;